#include <iostream>
using namespace std;

//初始化列表
class Person
{
public:
    int age;
    int money;
    int high;

    //传统的初始化操作
    // Person(int Age, int Money, int High)
    // {
    //     age = Age;
    //     money = Money;
    //     high = High;
    // }

    //初始化列表，初始化属性
    Person(int a,int b,int c):age(a), money(b), high(c)
    {
    }

};

void test1()
{
    Person p(10, 3000, 180);//传统初始化
    
    cout << "p的年龄为：" << p.age 
        << "\tp的存款为：" << p.money 
        << "\tp的身高为：" << p.high << endl;

    Person p1(50,1500,185);//初始化列表
    cout << "p1的年龄为：" << p1.age 
        << "\tp1的存款为：" << p1.money 
        << "\tp1的身高为：" << p1.high << endl;
}

int main()
{
    test1();
    return 0;
}